package com.bole.dao;

import com.bole.pojo.MenuRoleDo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

@Transactional
public interface MenuRoleDao extends JpaRepository<MenuRoleDo, Long> {
    @Query("from MenuRoleDo where roleId = ?1")
    List<MenuRoleDo> findMenuRoleDoByRoleId(Long id);
    @Query(value = "select rm.menu_id from tb_role r, menu_role rm where r.id = rm.role_id and r.id=?1",
            nativeQuery = true)
    List<Long> selectRoleMenuByRid(Long rid);
}
